package com.javakc.copyrightin.batch.dao;


import com.javakc.commonutils.jpa.base.dao.BaseDao;
import com.javakc.copyrightin.batch.entity.Batch;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

public interface BatchDao extends BaseDao<Batch,Integer> {

    @Query(value="select distinct first_id,first_name from cms_sort", nativeQuery=true)
    List<Map<Integer,String>> queryFirstSort();

    @Query(value="select distinct second_id,second_name from cms_sort where first_id = :id", nativeQuery=true)
    List<Map<Integer,String>> querySecondSort(@Param("id") Integer id);

    @Query(value="select distinct second_name from cms_sort where second_id = :id", nativeQuery=true)
    String viewSecondSort(@Param("id") Integer id);

}
